< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03010101.xhp

(section: msgbox) (bookmark: bm_id1807916)
MsgBox statement

MsgBox ステートメント

MsgBox Statement [Runtime]
MsgBox ステートメント [実行時](hd_id3154927.1)

Displays a dialog box containing a message.
メッセージ表示用のダイアログボックスを表示します。(par_id3148947.2)

(/section: msgbox)

Syntax:
構文:(hd_id3153897.3)

MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function)
MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) ないしは MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function)(par_id3148664.4)

Parameter:
パラメータ:(hd_id3153361.5)

Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).
Text:ダイアログボックスにメッセージとして表示する文字列表式。表示メッセージを改行する場合は、該当箇所に Chr$(13) を挿入します。(par_id3148798.6)

DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application.
DialogTitle:ダイアログボックスのタイトルバーに表示する文字列表式。指定を省略した場合、タイトルバーには該当するアプリケーション名が表示されます。(par_id3150769.7)

Type: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. Type represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values:
Type:ダイアログ本体の種類および、ダイアログ上に表示するボタンの数と種類とアイコンを指定する整数表式。この Type の値は、ビットパターンの組み合わせで指定するもので、該当する個々のダイアログ要素を示す値の合計値を指定します。(par_id3147228.8)

0 : Display OK button only.
0 : OK ボタンのみを表示させます。(par_id3161832.9)

1 : Display OK and Cancel buttons.
1 : OK およびキャンセルの各ボタンを表示させます。(par_id3153726.10)

2 : Display Abort, Retry, and Ignore buttons.
2 : 中止、やり直し、および取消しの各ボタンを表示させます。(par_id3149665.11)

3 : Display Yes, No and Cancel buttons.
3 : はい、いいえ、キャンセルの各ボタンを表示させます。(par_id3147318.12)

4 : Display Yes and No buttons.
4 : はい、いいえの各ボタンを表示させます。(par_id3155412.13)

5 : Display Retry and Cancel buttons.
5 : やり直しおよびキャンセルの各ボタンを表示させます。(par_id3146119.14)

16 : Add the Stop icon to the dialog.
16 : ダイアログ上にストップ記号のアイコンを表示させます。(par_id3159155.15)

32 : Add the Question icon to the dialog.
32 : ダイアログ上に疑問符のアイコンを表示させます。(par_id3145366.16)

48 : Add the Exclamation icon to the dialog.
48 : ダイアログ上に感嘆符のアイコンを表示させます。(par_id3147350.17)

64 : Add the Information icon to the dialog.
64 : ダイアログ上にインフォメーション記号のアイコンを表示させます。(par_id3149960.18)

128 : First button in the dialog as default button.
128 : ダイアログ上の 1 番目のボタンを、標準ボタンとします。(par_id3154944.19)

256 : Second button in the dialog as default button.
256 : ダイアログ上の 2 番目のボタンを、標準ボタンとします。(par_id3155417.20)

512 : Third button in the dialog as default button.
512 : ダイアログ上の 3 番目のボタンを、標準ボタンとします。(par_id3153878.21)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3150715.22)

Sub ExampleMsgBox
Sub ExampleMsgBox(par_id3154511.23)

Const sText1 = "An unexpected error occurred."
Const sText1 = "An unexpected error occurred."(par_id3150327.24)

Const sText2 = "The program execution will continue, however."
Const sText2 = "The program execution will continue, however."(par_id3146912.25)

Const sText3 = "Error"
Const sText3 = "Error"(par_id3154757.26)

MsgBox(sText1 + Chr(13) + sText2,16,sText3)
MsgBox(sText1 + Chr(13) + sText2,16,sText3)(par_id3155445.27)

End sub
End sub(par_id3155768.28)


< Prev / Next >